Optimal. Leaf size=236 \[ -\frac{B h n x (b c-a d) \left (a^2 d^2 h^2-a b d h (4 d g-c h)+b^2 \left (c^2 h^2-4 c d g h+6 d^2 g^2\right )\right )}{4 b^3 d^3}+\frac{(g+h x)^4 \left (B \log \left (e (a+b x)^n (c+d x)^{-n}\right )+A\right )}{4 h}-\frac{B h^2 n x^2 (b c-a d) (-a d h-b c h+4 b d g)}{8 b^2 d^2}-\frac{B n (b g-a h)^4 \log (a+b x)}{4 b^4 h}-\frac{B h^3 n x^3 (b c-a d)}{12 b d}+\frac{B n (d g-c h)^4 \log (c+d x)}{4 d^4 h} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.455644, antiderivative size = 248, normalized size of antiderivative = 1.05, number of steps used = 5, number of rules used = 3, integrand size = 31, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.097, Rules used = {6742, 2492, 72} \[ -\frac{B h n x (b c-a d) \left (a^2 d^2 h^2-a b d h (4 d g-c h)+b^2 \left (c^2 h^2-4 c d g h+6 d^2 g^2\right )\right )}{4 b^3 d^3}-\frac{B h^2 n x^2 (b c-a d) (-a d h-b c h+4 b d g)}{8 b^2 d^2}-\frac{B n (b g-a h)^4 \log (a+b x)}{4 b^4 h}+\frac{B (g+h x)^4 \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{4 h}-\frac{B h^3 n x^3 (b c-a d)}{12 b d}+\frac{A (g+h x)^4}{4 h}+\frac{B n (d g-c h)^4 \log (c+d x)}{4 d^4 h} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 6742
Rule 2492
Rule 72
Rubi steps
\begin{align*} \int (g+h x)^3 \left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right ) \, dx &=\int \left (A (g+h x)^3+B (g+h x)^3 \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right ) \, dx\\ &=\frac{A (g+h x)^4}{4 h}+B \int (g+h x)^3 \log \left (e (a+b x)^n (c+d x)^{-n}\right ) \, dx\\ &=\frac{A (g+h x)^4}{4 h}+\frac{B (g+h x)^4 \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{4 h}-\frac{(B (b c-a d) n) \int \frac{(g+h x)^4}{(a+b x) (c+d x)} \, dx}{4 h}\\ &=\frac{A (g+h x)^4}{4 h}+\frac{B (g+h x)^4 \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{4 h}-\frac{(B (b c-a d) n) \int \left (\frac{h^2 \left (a^2 d^2 h^2-a b d h (4 d g-c h)+b^2 \left (6 d^2 g^2-4 c d g h+c^2 h^2\right )\right )}{b^3 d^3}+\frac{h^3 (4 b d g-b c h-a d h) x}{b^2 d^2}+\frac{h^4 x^2}{b d}+\frac{(b g-a h)^4}{b^3 (b c-a d) (a+b x)}+\frac{(d g-c h)^4}{d^3 (-b c+a d) (c+d x)}\right ) \, dx}{4 h}\\ &=-\frac{B (b c-a d) h \left (a^2 d^2 h^2-a b d h (4 d g-c h)+b^2 \left (6 d^2 g^2-4 c d g h+c^2 h^2\right )\right ) n x}{4 b^3 d^3}-\frac{B (b c-a d) h^2 (4 b d g-b c h-a d h) n x^2}{8 b^2 d^2}-\frac{B (b c-a d) h^3 n x^3}{12 b d}+\frac{A (g+h x)^4}{4 h}-\frac{B (b g-a h)^4 n \log (a+b x)}{4 b^4 h}+\frac{B (d g-c h)^4 n \log (c+d x)}{4 d^4 h}+\frac{B (g+h x)^4 \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{4 h}\\ \end{align*}
Mathematica [A] time = 0.566985, size = 314, normalized size = 1.33 \[ \frac{b d x \left (6 A b^3 d^3 \left (6 g^2 h x+4 g^3+4 g h^2 x^2+h^3 x^3\right )-B h n (b c-a d) \left (6 a^2 d^2 h^2-3 a b d h (-2 c h+8 d g+d h x)+b^2 \left (6 c^2 h^2-3 c d h (8 g+h x)+2 d^2 \left (18 g^2+6 g h x+h^2 x^2\right )\right )\right )\right )-6 a^2 B d^4 h n \left (a^2 h^2-4 a b g h+6 b^2 g^2\right ) \log (a+b x)+6 b^3 B n \log (c+d x) \left (4 a d^4 g^3+b c \left (-4 c^2 d g h^2+c^3 h^3+6 c d^2 g^2 h-4 d^3 g^3\right )\right )+6 b^3 B d^4 \left (4 a g^3+b x \left (6 g^2 h x+4 g^3+4 g h^2 x^2+h^3 x^3\right )\right ) \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{24 b^4 d^4} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [C] time = 0.613, size = 1967, normalized size = 8.3 \begin{align*} \text{result too large to display} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] time = 1.20409, size = 630, normalized size = 2.67 \begin{align*} \frac{1}{4} \, B h^{3} x^{4} \log \left (\frac{{\left (b x + a\right )}^{n} e}{{\left (d x + c\right )}^{n}}\right ) + \frac{1}{4} \, A h^{3} x^{4} + B g h^{2} x^{3} \log \left (\frac{{\left (b x + a\right )}^{n} e}{{\left (d x + c\right )}^{n}}\right ) + A g h^{2} x^{3} + \frac{3}{2} \, B g^{2} h x^{2} \log \left (\frac{{\left (b x + a\right )}^{n} e}{{\left (d x + c\right )}^{n}}\right ) + \frac{3}{2} \, A g^{2} h x^{2} + B g^{3} x \log \left (\frac{{\left (b x + a\right )}^{n} e}{{\left (d x + c\right )}^{n}}\right ) + A g^{3} x + \frac{{\left (\frac{a e n \log \left (b x + a\right )}{b} - \frac{c e n \log \left (d x + c\right )}{d}\right )} B g^{3}}{e} - \frac{3 \,{\left (\frac{a^{2} e n \log \left (b x + a\right )}{b^{2}} - \frac{c^{2} e n \log \left (d x + c\right )}{d^{2}} + \frac{{\left (b c e n - a d e n\right )} x}{b d}\right )} B g^{2} h}{2 \, e} + \frac{{\left (\frac{2 \, a^{3} e n \log \left (b x + a\right )}{b^{3}} - \frac{2 \, c^{3} e n \log \left (d x + c\right )}{d^{3}} - \frac{{\left (b^{2} c d e n - a b d^{2} e n\right )} x^{2} - 2 \,{\left (b^{2} c^{2} e n - a^{2} d^{2} e n\right )} x}{b^{2} d^{2}}\right )} B g h^{2}}{2 \, e} - \frac{{\left (\frac{6 \, a^{4} e n \log \left (b x + a\right )}{b^{4}} - \frac{6 \, c^{4} e n \log \left (d x + c\right )}{d^{4}} + \frac{2 \,{\left (b^{3} c d^{2} e n - a b^{2} d^{3} e n\right )} x^{3} - 3 \,{\left (b^{3} c^{2} d e n - a^{2} b d^{3} e n\right )} x^{2} + 6 \,{\left (b^{3} c^{3} e n - a^{3} d^{3} e n\right )} x}{b^{3} d^{3}}\right )} B h^{3}}{24 \, e} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] time = 1.10268, size = 1149, normalized size = 4.87 \begin{align*} \frac{6 \, A b^{4} d^{4} h^{3} x^{4} + 2 \,{\left (12 \, A b^{4} d^{4} g h^{2} -{\left (B b^{4} c d^{3} - B a b^{3} d^{4}\right )} h^{3} n\right )} x^{3} + 3 \,{\left (12 \, A b^{4} d^{4} g^{2} h -{\left (4 \,{\left (B b^{4} c d^{3} - B a b^{3} d^{4}\right )} g h^{2} -{\left (B b^{4} c^{2} d^{2} - B a^{2} b^{2} d^{4}\right )} h^{3}\right )} n\right )} x^{2} + 6 \,{\left (4 \, A b^{4} d^{4} g^{3} -{\left (6 \,{\left (B b^{4} c d^{3} - B a b^{3} d^{4}\right )} g^{2} h - 4 \,{\left (B b^{4} c^{2} d^{2} - B a^{2} b^{2} d^{4}\right )} g h^{2} +{\left (B b^{4} c^{3} d - B a^{3} b d^{4}\right )} h^{3}\right )} n\right )} x + 6 \,{\left (B b^{4} d^{4} h^{3} n x^{4} + 4 \, B b^{4} d^{4} g h^{2} n x^{3} + 6 \, B b^{4} d^{4} g^{2} h n x^{2} + 4 \, B b^{4} d^{4} g^{3} n x +{\left (4 \, B a b^{3} d^{4} g^{3} - 6 \, B a^{2} b^{2} d^{4} g^{2} h + 4 \, B a^{3} b d^{4} g h^{2} - B a^{4} d^{4} h^{3}\right )} n\right )} \log \left (b x + a\right ) - 6 \,{\left (B b^{4} d^{4} h^{3} n x^{4} + 4 \, B b^{4} d^{4} g h^{2} n x^{3} + 6 \, B b^{4} d^{4} g^{2} h n x^{2} + 4 \, B b^{4} d^{4} g^{3} n x +{\left (4 \, B b^{4} c d^{3} g^{3} - 6 \, B b^{4} c^{2} d^{2} g^{2} h + 4 \, B b^{4} c^{3} d g h^{2} - B b^{4} c^{4} h^{3}\right )} n\right )} \log \left (d x + c\right ) + 6 \,{\left (B b^{4} d^{4} h^{3} x^{4} + 4 \, B b^{4} d^{4} g h^{2} x^{3} + 6 \, B b^{4} d^{4} g^{2} h x^{2} + 4 \, B b^{4} d^{4} g^{3} x\right )} \log \left (e\right )}{24 \, b^{4} d^{4}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]